/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package connect;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;

/**
 *
 * @author Thuan
 */
public class test {
    public static void main(String[] args) throws SQLException {
        ConnectDatabase kn = new ConnectDatabase();
        Connection con = kn.connect();
//        Statement stm = con.createStatement();
//        ResultSet rs = stm.executeQuery("Select * from KhachHang");
//        while(rs.next()){
//            System.out.println(rs.getString("MaKhachHang"));
//        }
        
        CallableStatement cstmt = con.prepareCall("{call sp_TKKH(?,?,?,?,?,?)}");
                cstmt.setObject(1, "kh1");
                cstmt.setObject(2, "");
                cstmt.setObject(3, "");
                cstmt.setObject(4, "");
                cstmt.setObject(5, "");
                cstmt.setObject(6, "");
                ResultSet rs = cstmt.executeQuery();
                Vector v;
                while(rs.next()){
                    System.out.println(rs.getObject(1));
                }
        rs.close();
        cstmt.close();
        con.close();
    }
}
